lswt

lswt lists wayland toplevels ("windows"), either in human readable or machine parseable formats.

$ lswt
app-id:    title:
terminal   /home/leon
terminal   /home/leon/Projects/digital-garden/garden
emacs      "lswt.org  |  wayland.org"
firefox    "Wayland — Mozilla Firefox"

It will work on any wayland server implementing either the ext-foreign-toplevel-list-v1 or the wlr-foreign-toplevel-management-unstable-v1 protocol.

You can find the code repository on sourcehut.

lswt(1)

LSWT(1)                                  General Commands Manual                                 LSWT(1)

NAME
     lswt - list Wayland toplevels

SYNOPSIS
     lswt [-j] [--json] [-c custom-format] [--custom custom-format] [--force-protocol protocol]
     lswt [-h] [--help]
     lswt [-w] [--watch]
     lswt [-v] [--version]

DESCRIPTION
     lswt lists all toplevels ("Windows") advertised by a Wayland server.

     The  default  output  prints the title and app-id the toplevels and - if available - their state in
     human readable form.

     The state is a four wide character field, corresponding to the four possible toplevel states: maxi‐
     mized, minimized, activated and fullscreen.  If one of these states is true for a toplevel, the re‐
     spective character in the field is set to the first letter of the state name, otherwise it is -.

     lswt provides two output formats intended to be machine parseable: JSON and CSV.  If the CSV output
     is chosen, a custom format must be provided, which specifies the information  about  the  toplevels
     lswt should print.  The JSON output is versioned.

     lswt also supports a watch mode, which will run continuosly and log whenever toplevels change their
     app-id or title.  The watch mode is incompatible with the JSON and CSV output formats.

SUPPORTED PROTOCOLS
     The information is querried from the Wayland server via one of the following protocols:

     • ext-foreign-toplevel-list-v1 (preferred)

     • wlr-foreign-toplevel-management-unstable-v1

     As  of now, only the ext- protocol supports unique toplevel IDs and only the wlr- protocol supports
     toplevel states.

OPTIONS
     -h, --help
            Print help text and exit.

     -v, --version
            Print version and exit.

     -w, --watch
            Run in watch mode.

     -j, --json
            Output data in the JSON format.

     -c custom-format, --custom custom-format
            Output data in the CSV format.  A custom format must be provided which specifies  which  in‐
            formation about the toplevels lswt should print.  This format is a string where each charac‐
            ter  corresponds  to one field.  Fields can be specified multiple times.  At least one field
            must be provided.  The following fields are supported:
                   CHARACTER   FIELD
                   ────────────────────────────────────────
                   t           title
                   a           app-id
                   i           unique identifier
                   A           activated? ("focused?")
                   f           fullscreen?
                   m           minimized?
                   M           maximized?

     --force-protocol protocol-name
            Force the use of the specified protocl.  lswt will not fall back onto  another  protocol  if
            the specified one is not supported.  See the SUPPORTED PROTOCOLS section for protocol names.

AUTHOR
     Leon Henrik Plickat

git.sr.ht/~leon_plickat/lswt                   2024-05-17                                        LSWT(1)